<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : eventPtcChidLayer.jsp
    Description : 이벤트 참가자 레이어
    author jkKim
    since 2012. 5. 10.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 5. 10.     jkKim     최초 생성
--%>
<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<div class="person-info-wrap">
    <div class="person-info">
        <table summary="">
        <colgroup>
            <col width="25%" />
            <col />
        </colgroup>
        <tbody>
        <tr>
            <th scope="row"><img src="/kr/images/layerpopup/txt_person_info01.png" alt="이름" /></th>
            <td>${userInfo.mbrNm}
                <input type="hidden" id="evntMnSn" name="evntMnSn" value="${evntMnVO.evntMnSn }"/>
                <input type="hidden" id="evntType" name="evntType" value="${evntMnVO.evntType}"/>
                <input type="hidden" id="ptcChidNm" name="ptcChidNm" value="${userInfo.mbrNm}"/>
            </td>
        </tr>   
        <tr>
            <th scope="row"><img src="/kr/images/layerpopup/txt_person_info02.png" alt="휴대폰 번호" /></th>
            <td class="input">
                <select class="select select-type1" style="width:56px;" id="hpNo1">
                    <able:hmcCodeTag type="option" gCd="HP" defValue="${fn:substring(userInfo.hpNo, 0, 3)}"/>
                </select>
                <c:if test="${fn:length(userInfo.hpNo) != 12 && fn:length(userInfo.hpNo) != 13}"> 
                    -
                    <input type="text" class="txt" style="width:52px" title="앞자리 입력" id="hpNo2" maxlength="4" value="" onKeyup="numbersOnly(this)"/>
                    -
                    <input type="text" class="txt" style="width:52px" title="뒷자리 입력" id="hpNo3" maxlength="4" value="" onKeyup="numbersOnly(this)"/>
                </c:if> 
                <c:if test="${fn:length(userInfo.hpNo) == 12}">
                    -
                    <input type="text" class="txt" style="width:52px" title="앞자리 입력" id="hpNo2" maxlength="4" value="${fn:substring(userInfo.hpNo, 4, 7)}" onKeyup="numbersOnly(this)"/>
                    -
                    <input type="text" class="txt" style="width:52px" title="뒷자리 입력" id="hpNo3" maxlength="4" value="${fn:substring(userInfo.hpNo, 8, 12)}" onKeyup="numbersOnly(this)"/>
                </c:if>
                <c:if test="${fn:length(userInfo.hpNo) == 13}">
                    -
                    <input type="text" class="txt" style="width:52px" title="앞자리 입력" id="hpNo2" maxlength="4" value="${fn:substring(userInfo.hpNo, 4, 8)}" onKeyup="numbersOnly(this)"/>
                    -
                    <input type="text" class="txt" style="width:52px" title="뒷자리 입력" id="hpNo3" maxlength="4" value="${fn:substring(userInfo.hpNo, 9, 13)}" onKeyup="numbersOnly(this)"/>
                </c:if>
            </td>
        </tr>
        <tr>
            <th scope="row"><img src="/kr/images/layerpopup/txt_person_info07.png" alt="생년월일" /></th>
            <td class="input">
                
                <select class="select select-type1" style="width:60px; overflow-" id="year">
                    <jsp:useBean id="now" class="java.util.Date"/> 
                    <fmt:formatDate value="${now}" pattern="yyyy"  var="num2"/>
                    <c:forEach var="i" begin="0" varStatus="status" end="105" > 
                        <c:if test="${fn:substring(userInfo.tymd, 0, 4) == (num2 - status.index)}">
                            <option value="<fmt:formatNumber minIntegerDigits="2" value="${num2 - status.index}" pattern="##"/>" selected="selected"><fmt:formatNumber minIntegerDigits="2" value="${num2 - status.index}" pattern="##"/></option>
                        </c:if> 
                        <c:if test="${fn:substring(userInfo.tymd, 0, 4) != (num2 - status.index)}">
                            <option value="<fmt:formatNumber minIntegerDigits="2" value="${num2 - status.index}" pattern="##"/>"><fmt:formatNumber minIntegerDigits="2" value="${num2 - status.index}" pattern="##"/></option>
                        </c:if>
                        
                    </c:forEach>
                </select>
                <span class="in-input">년</span>
                <select class="select select-type1 space" style="width:56px;" id="mon">
                    <c:forEach var="i" begin="1" varStatus="status" end="12">
                        <fmt:formatNumber minIntegerDigits="2" value="${status.index}" pattern="##" var="selectNum"/>
                        <c:if test="${fn:substring(userInfo.tymd, 4, 6) == selectNum}">  
                            <option value="${selectNum }" selected="selected">${selectNum }</option>
                        </c:if> 
                        <c:if test="${fn:substring(userInfo.tymd, 4, 6) != status.index}">
                           <option value="<fmt:formatNumber minIntegerDigits="2" value="${status.index}" pattern="##"/>"><fmt:formatNumber minIntegerDigits="2" value="${status.index}" pattern="##"/></option>
                        </c:if>
                    </c:forEach>
                </select> 
                <span class="in-input">월</span>
                <select class="select select-type1 space" style="width:56px;" id="day">
                    <c:forEach var="i" begin="1" varStatus="status" end="31">
                        <fmt:formatNumber minIntegerDigits="2" value="${status.index}" pattern="##" var="selectNum"/>
                        <c:if test="${fn:substring(userInfo.tymd, 6, 8) == status.index}">
                            <option value="${selectNum }" selected="selected">${selectNum }</option>
                        </c:if> 
                        <c:if test="${fn:substring(userInfo.tymd, 6, 8) != status.index}">
                           <option value="${selectNum }">${selectNum }</option>
                        </c:if>
                    </c:forEach>
                </select>
                <span class="in-input">일</span>
            </td>
        </tr> 
        <tr>
            <th scope="row"><img src="/kr/images/layerpopup/txt_person_info08.png" alt="성별" /></th>
            <td class="input"> 
                <select class="select select-type1" style="width:56px;" id="ptcChidSex">
                    <able:hmcCodeTag type="option" gCd="SEX" selectValue="${userInfo.mbrSex}"/>
                </select> 
            </td>
        </tr>
        <tr>
            <th scope="row"><img src="/kr/images/layerpopup/txt_person_info03.png" alt="주소(거주지)" /></th>
            <td class="input">
                <input type="text" class="txt" style="width:52px" id="zipSn01" name="zipSn01" value="${fn:substring(userInfo.zipSn, 0, 3)}" realonly/>
                -
                <input type="text" class="txt" style="width:52px" id="zipSn02" name="zipSn02" value="${fn:substring(userInfo.zipSn, 3, 6)}" realonly/>
                <a href="javascript:zipCodePopUp('zipCode');"><img src="/kr/images/layerpopup/btn_zipcode.gif" alt="우편번호 검색" /></a>
                <div class="sect">
                    <input type="text" class="txt" style="width:282px" id="adr" name="adr" title="주소 입력" value="${userInfo.adr}" realonly/>
                </div>
                <div class="sect">
                    <input type="text" class="txt" style="width:282px" id="dtlAdr" name="dtlAdr" title="나머지 주소 입력"  value="${userInfo.dtlAdr}"/>
                    <input type="hidden" id="wpaNm" name="wpaNm" value=""/>
                    <input type="hidden" id="admzNm" name="admzNm" value=""/>
                    <input type="hidden" id="zipScn" name="zipScn" value=""/>
                </div>
            </td>
        </tr>
        </tbody>
        </table> 
    </div>
    <div class="etc-function">
        <!-- label><input type="checkbox" class="check" id="addrCheck" name="addrCheck" value="1"/> 위 정보를  회원정보로 변경 하시겠습니까?</label-->
        <br/>※ 정확한 개인정보를 입력하지 않으시면 서비스 이용에 불이익이 있을 수 있습니다.
        <br/>※ 새로 입력된 정보는 가입정보에 반영되어 업데이트 됩니다.        
    </div>
    <div class="btnwrap">
        <a href="javascript:evntInsertBe()"><img src="/kr/images/layerpopup/btn_confirm02.gif" alt="확인" /></a>
        <a href="javascript:closeLayer()"><img src="/kr/images/layerpopup/btn_cancel.gif" alt="취소" /></a>
    </div>
</div>
<script>
$('#hpNo1, #year, #mon, #day, #ptcChidSex').customSelect(); 

function numbersOnly(obj)
{
    var str = obj.value;
   
    if(str.length > 0)
    {
        if(isNaN(str) == true )
        {
            alert("숫자만 입력 가능합니다");
            obj.value = "";
            return false;
        }    
    }
    
    return true;
    
}
</script>